package org.insia.smartposse.mapping.base;

import java.io.Serializable;


/**
 * This is an object that contains data related to the freelance_books table.
 * Do not modify this class because it will be overwritten if the configuration file
 * related to this class is modified.
 *
 * @hibernate.class
 *  table="freelance_books"
 */

public abstract class BaseFreelanceBooks  implements Serializable {

	public static String REF = "FreelanceBooks";
	public static String PROP_COMMENT = "Comment";
	public static String PROP_URL = "Url";
	public static String PROP_FREELANCE = "Freelance";
	public static String PROP_ID = "Id";


	// constructors
	public BaseFreelanceBooks () {
		initialize();
	}

	/**
	 * Constructor for primary key
	 */
	public BaseFreelanceBooks (java.lang.Integer id) {
		this.setId(id);
		initialize();
	}

	protected void initialize () {}



	private int hashCode = Integer.MIN_VALUE;

	// primary key
	private java.lang.Integer id;

	// fields
	private java.lang.String url;
	private java.lang.String comment;

	// many to one
	private org.insia.smartposse.mapping.Users freelance;



	/**
	 * Return the unique identifier of this class
     * @hibernate.id
     *  generator-class="increment"
     *  column="freelance_books_id"
     */
	public java.lang.Integer getId () {
		return id;
	}

	/**
	 * Set the unique identifier of this class
	 * @param id the new ID
	 */
	public void setId (java.lang.Integer id) {
		this.id = id;
		this.hashCode = Integer.MIN_VALUE;
	}




	/**
	 * Return the value associated with the column: url
	 */
	public java.lang.String getUrl () {
		return url;
	}

	/**
	 * Set the value related to the column: url
	 * @param url the url value
	 */
	public void setUrl (java.lang.String url) {
		this.url = url;
	}



	/**
	 * Return the value associated with the column: comment
	 */
	public java.lang.String getComment () {
		return comment;
	}

	/**
	 * Set the value related to the column: comment
	 * @param comment the comment value
	 */
	public void setComment (java.lang.String comment) {
		this.comment = comment;
	}



	/**
	 * Return the value associated with the column: freelance_id
	 */
	public org.insia.smartposse.mapping.Users getFreelance () {
		return freelance;
	}

	/**
	 * Set the value related to the column: freelance_id
	 * @param freelance the freelance_id value
	 */
	public void setFreelance (org.insia.smartposse.mapping.Users freelance) {
		this.freelance = freelance;
	}




	public boolean equals (Object obj) {
		if (null == obj) return false;
		if (!(obj instanceof org.insia.smartposse.mapping.FreelanceBooks)) return false;
		else {
			org.insia.smartposse.mapping.FreelanceBooks freelanceBooks = (org.insia.smartposse.mapping.FreelanceBooks) obj;
			if (null == this.getId() || null == freelanceBooks.getId()) return false;
			else return (this.getId().equals(freelanceBooks.getId()));
		}
	}

	public int hashCode () {
		if (Integer.MIN_VALUE == this.hashCode) {
			if (null == this.getId()) return super.hashCode();
			else {
				String hashStr = this.getClass().getName() + ":" + this.getId().hashCode();
				this.hashCode = hashStr.hashCode();
			}
		}
		return this.hashCode;
	}


	public String toString () {
		return super.toString();
	}


}